<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%><%@ include file="pub/top.jsp"%>
<%@ page import="java.util.List,java.util.Map"%>
<!-- 全局变量 函数定义区 -->
<%!%>
<!-- 实例变量 函数定义区 -->
<%
	//网页title
	String JSPTITLE = "修改密码";
%>
<%@ include file="pub/head.jsp"%>
<!-- 样式添加区 -->
<link rel="stylesheet" href="<%=basePath%>DataTables/datatables.min.css">
<!-- 下右内容区 -->
<style>

</style>

<div class="main-content-inner">
	<div class="breadcrumbs ace-save-state" id="breadcrumbs">
		<ul class="breadcrumb">
			<li><i class="ace-icon fa fa-home home-icon"></i>系统设置</li>
			<li class="active"><%=JSPTITLE%></li>
		</ul>
	</div>
	<div class="page-content">
		<!-- page-header{ -->
		<div class="page-header">
			<!-- table header1{ -->
			<div class="row">
				<div class="col-xs-12">
					<div class="clearfix">
						<div class="pull-right tableTools-container"></div>
						<div class="">
							<div class="btn-group" style="margin-top: 5px">
								<a href="#" class="btn-refresh btn  btn-xs "> <i
									class="im-spinner10 fa-spin"></i> 刷新
								</a>
								<!-- <a data-toggle="collapse" href="#demo" class=" btn  btn-xs ">
									<i class="im-spinner10 fa-spin"></i>搜索
								</a> -->
							</div>
						</div>
					</div>
					<div id="demo" class="panel-collapse collapse ">
						<div class="panel-body well">
							<form>
								<%-- <div class="col-lg-12 col-sm-12  input-group ">
									<span class="input-group-addon">
						          		<i class="fa fa-calendar"></i>
						         	</span>
							        <input type="date" name="start" value="<%=start %>">
							        &nbsp&nbsp
							        <span>至</span>
							        &nbsp&nbsp
							        <input type="date" name="end" value="<%=end %>"> 
							        &nbsp&nbsp&nbsp&nbsp
									<input type="text" name="uname" value="<%=uname %>" 
										placeholder="会员登录名" >
									&nbsp&nbsp
									<input type="text" name="ualias" value="<%=ualias %>" 
										placeholder="会员姓名" >
						        </div> --%>
								<div class="col-lg-12 col-sm-12">
									<button type="submit"
										class="btn btn-success btn-sm  pull-right">
										<span class="ace-icon fa fa-search icon-on-right bigger-110"></span>
										查找
									</button>
								</div>
							</form>
						</div>
					</div>
				</div>
			</div>
			<!-- }table -header1  -->
		</div>
		<!-- }page-header  -->

		<!-- table header2{ -->
		<div class="row">
			<div class="col-xs-9 tablehead2L"></div>
			<div class="col-xs-3 tablehead2R"></div>
		</div>
		<!-- }table -header2  -->
		<!--  table { -->
		<div class="row">
			<div class="col-xs-12">
						<div class="col-xs-12 col-sm-5" style="width:60%;margin-left:20%">
							<span class="block input-icon input-icon-right">旧密码 <input
								type="text" id="password" class="width-100" name="" />
							</span>
						</div>
					<br>
						<div class="col-xs-12 col-sm-5" style="width:60%;margin-left:20%">
							<span class="block input-icon input-icon-right">新密码 <input
								type="password" id="newpassword1" name="" class="width-100" />
							</span>
						</div>
					<br>
						<div class="col-xs-12 col-sm-5" style="width:60%;margin-left:20%">
							<span class="block input-icon input-icon-right">确认新密码 <input
								type="password" id="newpassword2" name="" class="width-100" onBlur="queren()"/> 
								<span id="hidden"></span>
							</span>
						</div>
					<br>
					<br>
						<div class="col-xs-12 col-sm-5" style="width:60%;margin-left:20%;margin-top:15px">
							<span class="block input-icon input-icon-right">
							<input type="button" class="btn btn-danger btn-block" onclick="change()" value="保存信息">
							</span>
						</div>
			</div>
		</div>
	</div>
</div>

<a href="#" id="btn-scroll-up"
	class="btn-scroll-up btn btn-sm btn-inverse"> <i
	class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
</a>

<%@ include file="pub/bottom.jsp"%>
<!-- 引入组件库 -->
<script src="<%=basePath%>DataTables/datatables.min.js"></script>
<script src="<%=basePath%>js/hyl.page.js"></script>
<script src="<%=basePath%>js/md5.js"></script>
<!-- 自定义脚本 加载区 -->
<script>
	function queren(){
		var newpassword1 = $('#newpassword1').val();
		var newpassword2 = $('#newpassword2').val();
		if(newpassword1==newpassword2){
			$('#hidden').html('两次密码输入一致')
		}else{
			$('#hidden').html('两次密码输入不一致')
		}
	}
	
	function change(){
		var newpassword1 = hex_md5($('#newpassword1').val());
		var newpassword2 = hex_md5($('#newpassword2').val());
		var password = hex_md5($('#password').val());
		$.ajax({
			type : 'get',
			url : '<%=basePath%>admin/Dao/member_update_psw.jsp',
			data:{'password':password,'newpassword1':newpassword1,'newpassword2':newpassword2,'state':1},
			success : function(data) {
				if(data.MSG=="error"){
					alert("旧密码不正确");
					return;
				}else if(data.MSG=="wrong"){
					alert("两次密码输入不正确");
					return;
				}else{
					alert("修改成功");
					window.location.reload();
				}
			}
		});
	}

	
</script>
